package com.tjsinfo.tjsoa.articles.bo;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.tjsinfo.tjsoa.Dao.IHibernateDao;
import com.tjsinfo.tjsoa.Dao.IJDBCDao;
import com.tjsinfo.tjsoa.Dao.IQbcDao;
import com.tjsinfo.tjsoa.articles.vo.TIndexArticles;
import com.tjsinfo.tjsoa.articles.vo.TIndexView;



/**
 * 栏目附加信息BO
 * 查看、拼音、显示等
 * @author 天津市电子计算机研究所
 *
 */
	
public class IViewManageImpl implements IViewManage{
	private IQbcDao qbcDao;
	private IHibernateDao hibernateDao;
	private IJDBCDao jdbcDao;
//	private TArticlesFileUploadManage articlesFileUploadManage;
	
	public IHibernateDao getHibernateDao() {
		return hibernateDao;
	}

	public IJDBCDao getJdbcDao() {
		return jdbcDao;
	}

	public void setJdbcDao(IJDBCDao jdbcDao) {
		this.jdbcDao = jdbcDao;
	}

	public void setHibernateDao(IHibernateDao hibernateDao) {
		this.hibernateDao = hibernateDao;
	}

	public IQbcDao getQbcDao() {
		return qbcDao;
	}

	public void setQbcDao(IQbcDao qbcDao) {
		this.qbcDao = qbcDao;
	}

	public TIndexView findByICid(Integer cid) {
		// TODO Auto-generated method stub
		DetachedCriteria criteria = DetachedCriteria.forClass(TIndexView.class); 
		criteria.add(Restrictions.eq("cid", cid));
		return  (TIndexView) qbcDao.getCriteria(criteria).iterator().next();
	}

	public TIndexView findBySCid(String cid) {
		// TODO Auto-generated method stub
		Integer _cid= Integer.parseInt(cid);
		DetachedCriteria criteria = DetachedCriteria.forClass(TIndexView.class); 
		criteria.add(Restrictions.eq("cid", _cid));
		return  (TIndexView) qbcDao.getCriteria(criteria).iterator().next();
	}
	
	public void update(TIndexView indexview) {
		// TODO Auto-generated method stub
		hibernateDao.update(indexview);
	}
	

}


